﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Battle
{
    public class EnemyDeadLine : MonoBehaviour
    {
        private void OnTriggerEnter2D(Collider2D collision)
        {
            EnemyBase enemy = collision.gameObject.GetComponentInParent<EnemyBase>();
            if (enemy != null)
            {
                Player.MyPlayer.Ins.MyFort.HP.AddHp(-enemy.Hp);
                enemy.Death();
            }
        }
    }
}